%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% O-Ring Production Networks
%   Author: Demir, Fieler, Xu, Yang
%   Last updated: March 2023
%
% Purpose: Replication Package (Part II) Master File
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
close all; diary off; clc; clear; 


%% Estimation

    run('1 estimation/main_fullmodel_estimation.m')
    run('1 estimation/main_fullmodel_moments.m')

%% Standard Error

    run('2 standard error/main_fullmodel_standarderror.m')

%% Export Shock (Baseline) Counterfactual

    run('3 baseline counterfactual/main_baseline_counterfactual.m')

%% Export Subsidy Counterfactuals

    run('4 export subsidy counterfactuals/main_exportsubsidy_counterfactual.m')

%% Dissecting Mechanisms

    run('5 dissecting mechanisms/main_disecting_mechanisms.m')

%% Model with Imports

    run('6 model with imports/main_import_counterfactual.m')    

%% Endogenous Targeting

    run('7 endogenous targeting/main_endogtarget_1_initeqm_grid.m')
    run('7 endogenous targeting/main_endogtarget_2_wageresponse_cf.m')
    run('7 endogenous targeting/main_endogtarget_3_select_modelfit.m')

